package com.zt.ztyh.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.ztyh.dto.FundsDto;
import com.zt.ztyh.dto.FundsUserDto;
import com.zt.ztyh.entity.Funds;
import com.zt.ztyh.entity.User;
import com.zt.ztyh.entity.ZtyhFundsUser;

import com.zt.ztyh.vo.funds.FundsUserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
* @author 贾天旺
* @description 针对表【ztyh_funds】的数据库操作Mapper
* @createDate 2024-04-03 19:49:42
* @Entity com.zt.ztyh.domain.Funds
*/
public interface FundsMapper extends BaseMapper<Funds> {

    Page<Funds> selectFunds(Page<Funds> page, FundsDto fundsDto);

    Page<FundsUserVo> findByUser(@Param("page") Page<FundsUserVo> page,@Param("fundsDto") FundsDto fundsDto);

    ZtyhFundsUser fundsUserById(Long id);

    int updateFunds(FundsUserDto fundsUserDto);

    void unUpdateLoan(@Param("uid") Long uid,@Param("amount") BigDecimal amount,@Param("i") int i);


    void addFunds(@Param("uid") Long uid,@Param("fid") Long fid,@Param("amount") BigDecimal amount,@Param("id") Long id);

    @Select("select * from ztyh_user where id=#{id}")
    User selectUserUn(Long uid);
}




